﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="profile.aspx.vb" Inherits="diy_wc_prototype.profile" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:DetailsView ID="DetailsView1" runat="server" Height="74px" Width="598px" 
        DataSourceID="SqlDataSource1" AutoGenerateRows="False" DataKeyNames="ID">
        <Fields>
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="ID" />
            <asp:BoundField DataField="userLoc" HeaderText="userLoc" 
                SortExpression="userLoc" />
            <asp:BoundField DataField="userDesc" HeaderText="userDesc" 
                SortExpression="userDesc" />
            <asp:CommandField ShowEditButton="True" />
         </Fields>
    </asp:DetailsView>  
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
        DataKeyNames="ID" style="margin-right: 146px">
        <AlternatingItemTemplate>
            <span style="">ID:
            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
            <br />
            userLoc:
          <asp:DropDownList ID="ddl_userLoc" runat="server" DataSourceID="ds_countiesUk" DataTextField="counties"
        DataValueField="counties" AppendDataBoundItems="True">
        <asp:ListItem Text="Please select" Value="" />
    </asp:DropDownList>
            userDesc:
            <asp:Label ID="userDescLabel" runat="server" Text='<%# Eval("userDesc") %>' />
            <br />
            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
            <br />
            <br />
            </span>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <span style="">ID:
            <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
            <br />
            userLoc:
            <asp:TextBox ID="userLocTextBox" runat="server" Text='<%# Bind("userLoc") %>' />
            <br />
            userDesc:
            <asp:TextBox ID="userDescTextBox" runat="server" 
                Text='<%# Bind("userDesc") %>' />
            <br />
            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                Text="Update" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Cancel" />
            <br />
            <br />
            </span>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <span>No data was returned.</span>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <span style="">userLoc:
            <asp:TextBox ID="userLocTextBox" runat="server" Text='<%# Bind("userLoc") %>' />
            <br />
            userDesc:
            <asp:TextBox ID="userDescTextBox" runat="server" 
                Text='<%# Bind("userDesc") %>' />
            <br />
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                Text="Insert" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Clear" />
            <br />
            <br />
            </span>
        </InsertItemTemplate>
        <ItemTemplate>
            <span style="">ID:
            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
            <br />
            userLoc:
            <asp:Label ID="userLocLabel" runat="server" Text='<%# Eval("userLoc") %>' />
            <br />
            userDesc:
            <asp:Label ID="userDescLabel" runat="server" Text='<%# Eval("userDesc") %>' />
            <br />
            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
            <br />
            <br />
            </span>
        </ItemTemplate>
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
            </div>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <span style="">ID:
            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
            <br />
            userLoc:
            <asp:Label ID="userLocLabel" runat="server" Text='<%# Eval("userLoc") %>' />
            <br />
            userDesc:
            <asp:Label ID="userDescLabel" runat="server" Text='<%# Eval("userDesc") %>' />
            <br />
            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
            <br />
            <br />
            </span>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:diycakeConnectionString %>" 
        DeleteCommand="DELETE FROM [cakers] WHERE [ID] = ?" 
        InsertCommand="INSERT INTO [cakers] ([ID], [userLoc], [userDesc]) VALUES (?, ?, ?)" 
        ProviderName="<%$ ConnectionStrings:diycakeConnectionString.ProviderName %>" 
        SelectCommand="SELECT [ID], [userLoc], [userDesc] FROM [cakers] WHERE ([userUName] = ?)" 
        UpdateCommand="UPDATE [cakers] SET [userLoc] = ?, [userDesc] = ? WHERE [ID] = ?">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="userLoc" Type="String" />
            <asp:Parameter Name="userDesc" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:QueryStringParameter Name="userUName" QueryStringField="userUName" 
                Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="userLoc" Type="String" />
            <asp:Parameter Name="userDesc" Type="String" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:Button ID="btn_editProfile" runat="server" Text="Edit Profile" />
      <asp:Rating ID="Rating1" runat="server" StarCssClass="Star" WaitingStarCssClass="WaitingStar"
        FilledStarCssClass="FilledStar" EmptyStarCssClass="EmptyStar">
    </asp:Rating>
    <asp:Button ID="btn_rate" runat="server" Text="Rate" />
    <br />
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>


    <br />
</asp:Content>
